package com.ctshk.rpc.user.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Objects;

/**
 * <p>
 *  用户收藏REQ
 * </p>
 *
 * @author 李新科
 * @date 2021/5/17 11:35
 */
@Data
@ApiModel()
@Accessors(chain = true)
public class UserCollectionReq implements Serializable {

    @ApiModelProperty(value="用户id")
    private Long userId;

    @ApiModelProperty(value="类型,从SystemBusinessType类取值，1.2旅行团 6.7自由行 8.酒店 9.机票 10.火车票 11.船票 12.巴士票 13.机场快线 14.景点门票 15.当地玩乐 18.商品",required = true)
    @NotNull(message = "类型不能为空")
    private Integer type;

    @ApiModelProperty(value="标题")
    private String title;

    @ApiModelProperty(value="内容")
    private String content;

    @ApiModelProperty(value="币种id")
    private Long currencyId;

    @ApiModelProperty(value="币种")
    private String currency;

    @ApiModelProperty(value="金额")
    private BigDecimal price;

    @ApiModelProperty(value="封面地址")
    private String coverUrl;

    @ApiModelProperty(value="星级")
    private Integer starLevel;

    @ApiModelProperty(value="详情id",required = true)
    @NotNull(message = "详情id不能为空")
    private Long detailId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserCollectionReq that = (UserCollectionReq) o;
        return detailId.equals(that.detailId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(detailId);
    }
}
